<!--编辑管理员-->
<div class="dialog_content">
    <form id="info_form" action="{:U('Admin/edit')}" method="post">
        <table width="100%" class="table_form">
            <tr>
                <th width="80">{:L('admin_username')} :</th>
                <td>{$info.username}</td>
            </tr>
            <tr>
                <th>{:L('admin_realname')} :</th>
                <td><input type="text" name="realname" class="input-text" id="J_realname" value="{$info.realname}" ></td>
            </tr>
            <tr>
                <th>{:L('password')} :</th>
                <td><input type="password" name="password" id="J_password" class="input-text"></td>
            </tr>
            <tr>
                <th>{:L('cofirmpwd')} :</th>
                <td><input type="password" name="repassword" id="J_repassword" class="input-text"></td>
            </tr>
            <tr>
                <th>{:L('admin_email')} :</th>
                <td><input type="text" name="email" class="input-text" value="{$info.email}" size="30"></td>
            </tr>
            <tr>
                <th>{:L('admininrole')} :</th>
                <td>
                    <select name="role_id">
                        <volist name="role_list" id="val">
                            <option value="{$val.id}" <if condition="$val['id'] eq $info['role_id']">selected="selected"</if>>{$val.name}</option>
                        </volist>
                    </select>
                </td>
            </tr>
        </table>
        <input type="hidden" name="id" value="{$info.id}" />
    </form>
</div>

<script>
        <volist name=":L('js_lang_admin')" id="val">
        lang.{$key} = "{$val}";
        </volist>
    $(function(){
        $.formValidator.initConfig({formid:"info_form",autotip:true});
        $("#J_realname").formValidator({ onshow:'请输入真实姓名', onfocus:'请输入真实姓名'}).inputValidator({ min:2, max:10, onerror:'请输入真实姓名'});
        $("#J_password").formValidator({ empty:true, onshow:lang.not_edit_password, onfocus:lang.password+lang.between_6_to_20}).inputValidator({ min:6, max:20, onerror:lang.password+lang.between_6_to_20});
        $("#J_repassword").formValidator({ empty:true, onshow:lang.not_edit_password, onfocus:lang.cofirmpwd}).compareValidator({desid:"J_password",operateor:"=",onerror:lang.passwords_not_match});

        $('#info_form').ajaxForm({success:complate,dataType:'json'});
        function complate(result){
        if(result.status == 1){
            $.dialog.get(result.dialog).close();
            $.TP.tip({content:result.msg});
            window.location.reload();
        } else {
            $.TP.tip({content:result.msg, icon:'alert'});
        }
    }
    });
</script>